The x coordinate of the current room’s left edge. Because (0, 0) is the room’s top-left corner it is 0, but writing room_left() says what you mean, so the code reads clearly and stays right even in an older project that counts from the middle.
room_left() -> intint
Gives back the x position of the left edge of the room you are in. Use it any time you want to put something "a little way in from the left wall".
A coordinate is a number that says where something is: x counts across, and y counts down. To turn a number into a place, everyone has to agree where the counting starts. That starting spot is called the origin, and it is where x and y are both 0. A room's origin is its top-left corner (see Where (0, 0) is), so the room's left edge is 0, and x gets bigger as you go right, all the way to room_width() at the right edge. room_left() gives you that number.
You could just write 0. But room_left() + 16 is better than 16: it says what you mean. "16 pixels in from the left edge" is right there in the code. A bare 16 could be anything.
The room and the screen are different things. The room is the whole level, and it can be much bigger than what you see at once. The screen is the window you look at the level through, and on the GBA it is always the same size. room_left() is about the room. screen_width is about the screen, so the two only match when a room is exactly one screen wide.
x = room_left() + 16;Puts this instance 16 pixels in from the left edge of the room.
if (x < room_left() + 8) {
x = room_left() + 8;
}Stops this instance from going any further left than 8 pixels from the room's left edge, so it stays inside the room.
room_left() is a whole number of pixels, like room_width. It asks the room's size each time you call it rather than being one fixed number, because different rooms can be different sizes.
A short run-time call, not a constant, because rooms come in different sizes: it reads the current room’s width and asks the engine where a room that wide starts. With (0, 0) at the room’s top-left corner the answer is 0. (An older project that counts from the middle of the room gets minus half the width instead; the engine has one line that says so.)